home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / AppleScript.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  5.4 KB  |  199 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleScript.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN
  18. __APPLESCRIPT__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  27.     include 'AppleEvents.a'
  28.     ENDIF
  29. ;        include 'Types.a'                                            ;
  30. ;        include 'Memory.a'                                            ;
  31. ;            include 'MixedMode.a'                                    ;
  32. ;        include 'OSUtils.a'                                        ;
  33. ;        include 'Events.a'                                            ;
  34. ;            include 'Quickdraw.a'                                    ;
  35. ;                include 'QuickdrawText.a'                            ;
  36. ;        include 'EPPC.a'                                            ;
  37. ;            include 'PPCToolbox.a'                                    ;
  38. ;                include 'AppleTalk.a'                                ;
  39. ;            include 'Processes.a'                                    ;
  40. ;                include 'Files.a'                                    ;
  41. ;        include 'Notification.a'                                    ;
  42.  
  43.     IF &TYPE('__OSA__') = 'UNDEFINED' THEN
  44.     include 'OSA.a'
  45.     ENDIF
  46. ;        include 'AEObjects.a'                                        ;
  47. ;        include 'Components.a'                                        ;
  48.  
  49.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  50.     include 'TextEdit.a'
  51.     ENDIF
  52.  
  53. typeAppleScript                    EQU        'ascr'
  54. kAppleScriptSubtype                EQU        typeAppleScript
  55. typeASStorage                    EQU        typeAppleScript
  56.  
  57. ;*************************************************************************
  58. ;    Component Selectors
  59. ;*************************************************************************
  60. kASSelectInit                    EQU        $1001
  61. kASSelectSetSourceStyles        EQU        $1002
  62. kASSelectGetSourceStyles        EQU        $1003
  63. kASSelectGetSourceStyleNames    EQU        $1004
  64.  
  65. ;*************************************************************************
  66. ;    OSAGetScriptInfo Selectors
  67. ;*************************************************************************
  68. kASHasOpenHandler                EQU        'hsod'
  69.  
  70. ;
  71. ;        This selector is used to query a context as to whether it contains
  72. ;        a handler for the kAEOpenDocuments event. This allows "applets" to be 
  73. ;        distinguished from "droplets."  OSAGetScriptInfo returns false if
  74. ;        there is no kAEOpenDocuments handler, and returns the error value 
  75. ;        errOSAInvalidAccess if the input is not a context.
  76. ;    
  77. ;*************************************************************************
  78. ;    Initialization
  79. ;*************************************************************************
  80.     IF GENERATING68K THEN
  81.         Macro
  82.         _ASInit
  83.             dc.w     $2F3C
  84.             dc.w     $001C
  85.             dc.w     $1001
  86.             moveq    #0,d0
  87.             dc.w     $A82A
  88.         EndM
  89.     ELSE
  90.         IMPORT    ASInit
  91.     ENDIF
  92.  
  93. ;
  94. ;        ComponentCallNow(kASSelectInit, 28);
  95. ;        This call can be used to explicitly initialize AppleScript.  If it is
  96. ;        not called, the a scripting size resource is looked for and used. If
  97. ;        there is no scripting size resource, then the constants listed below
  98. ;        are used.  If at any stage (the init call, the size resource, the 
  99. ;        defaults) any of these parameters are zero, then parameters from the
  100. ;        next stage are used.  ModeFlags are not currently used.
  101. ;        Errors:
  102. ;        errOSASystemError        initialization failed
  103. ;    
  104. ;
  105. ;    These values will be used if ASInit is not called explicitly, or if any
  106. ;    of ASInit's parameters are zero:
  107. ;
  108. kASDefaultMinStackSize            EQU        4 * 1024
  109. kASDefaultPreferredStackSize    EQU        16 * 1024
  110. kASDefaultMaxStackSize            EQU        16 * 1024
  111. kASDefaultMinHeapSize            EQU        4 * 1024
  112. kASDefaultPreferredHeapSize        EQU        16 * 1024
  113. kASDefaultMaxHeapSize            EQU        32 * 1024 * 1024
  114.  
  115. ;*************************************************************************
  116. ;    Source Styles
  117. ;*************************************************************************
  118.     IF GENERATING68K THEN
  119.         Macro
  120.         _ASSetSourceStyles
  121.             dc.w     $2F3C
  122.             dc.w     $0004
  123.             dc.w     $1002
  124.             moveq    #0,d0
  125.             dc.w     $A82A
  126.         EndM
  127.     ELSE
  128.         IMPORT    ASSetSourceStyles
  129.     ENDIF
  130.  
  131. ;
  132. ;        ComponentCallNow(kASSelectSetSourceStyles, 4);
  133. ;        Errors:
  134. ;        errOSASystemError        operation failed
  135. ;    
  136.     IF GENERATING68K THEN
  137.         Macro
  138.         _ASGetSourceStyles
  139.             dc.w     $2F3C
  140.             dc.w     $0004
  141.             dc.w     $1003
  142.             moveq    #0,d0
  143.             dc.w     $A82A
  144.         EndM
  145.     ELSE
  146.         IMPORT    ASGetSourceStyles
  147.     ENDIF
  148.  
  149. ;
  150. ;        ComponentCallNow(kASSelectGetSourceStyles, 4);
  151. ;        Errors:
  152. ;        errOSASystemError        operation failed
  153. ;    
  154.     IF GENERATING68K THEN
  155.         Macro
  156.         _ASGetSourceStyleNames
  157.             dc.w     $2F3C
  158.             dc.w     $0008
  159.             dc.w     $1004
  160.             moveq    #0,d0
  161.             dc.w     $A82A
  162.         EndM
  163.     ELSE
  164.         IMPORT    ASGetSourceStyleNames
  165.     ENDIF
  166.  
  167. ;
  168. ;        ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  169. ;        This call returns an AEList of styled text descriptors the names of the
  170. ;        source styles in the current dialect.  The order of the names corresponds
  171. ;        to the order of the source style constants, below.  The style of each
  172. ;        name is the same as the styles returned by ASGetSourceStyles.
  173. ;        
  174. ;        Errors:
  175. ;        errOSASystemError        operation failed
  176. ;    
  177. ;
  178. ;    Elements of STHandle correspond to following categories of tokens, and
  179. ;    accessed through following index constants:
  180. ;
  181. kASSourceStyleUncompiledText    EQU        0
  182. kASSourceStyleNormalText        EQU        1
  183. kASSourceStyleLanguageKeyword    EQU        2
  184. kASSourceStyleApplicationKeyword EQU        3
  185. kASSourceStyleComment            EQU        4
  186. kASSourceStyleLiteral            EQU        5
  187. kASSourceStyleUserSymbol        EQU        6
  188. kASSourceStyleObjectSpecifier    EQU        7
  189. kASNumberOfSourceStyles            EQU        8
  190.  
  191. ; Gestalt selectors for AppleScript 
  192. gestaltAppleScriptAttr            EQU        'ascr'
  193. gestaltAppleScriptVersion        EQU        'ascv'
  194.  
  195. gestaltAppleScriptPresent        EQU        0
  196. gestaltAppleScriptPowerPCSupport EQU        1
  197.  
  198.     ENDIF ; __APPLESCRIPT__
  199.